1. Field of the Invention
The present invention relates to an arithmetic unit, such as a decimal calculation apparatus.
2. Description of the Related Art
Arithmetic systems equipped with an arithmetic unit, such as a CPU (Central Processing Unit), are popular. There are various standards for an arithmetic unit, a memory and so forth which constitute an arithmetic system. The ANSI/IEEE 754-1985 standard (hereinafter simply called “IEEE 754”) is an operation standard defining, for example, a binary floating-point operation. The IEEE 754 defines the numerical form (precision) that is handled in a binary floating-point operation in three types, namely, single precision (32 bits), double precision (64 bits) and long double precision (96 bits).
FIG. 28 is a diagram showing one example of the logical hierarchical structure of a conventional arithmetic system. The arithmetic system has a hierarchical structure having a CPU or an arithmetic unit as the lowermost layer, and an OS (Operating System) or the basic software which controls the CPU, a compiler which converts an overlying application program written in a high-level language to a machine-language program, a commercially available application, such as spreadsheet software or wordprocessing software, and a user application layered in order over the bottom layer.
As the conventional arithmetic system is built up as a circuit which performs an operation with a given precision (number of effective digits) as defined in, for example, the IEEE 754, it has the following shortcomings.
(1) Restriction on the Number of Effective Digits
The operation precision or the number of effective digits in the arithmetic system comprising the conventional arithmetic unit is limited to precisions defined by the operation standard (three types in the IEEE 754). That is, an operation with other numbers of digits than the specified number of effective digits cannot be performed. This disables execution of an operation with the exact precision required.
(2) Error in Binary Operation
As the arithmetic unit performs a binary operation, numerical data in the arithmetic system is expressed in binary notation. This requires binary-decimal conversion, so that an conversion-originated error is inevitable. In convergent calculation or the like, for example, every time a repetitive operation is performed, the error becomes larger with the restriction on the number of effective digits. To cancel the error, binary operations should be performed with a precision higher than the precision of decimal operations.
(3) Complex Program Writing Due to Restriction on the Number of Effective Digits
The arithmetic unit is constructed in such a way as to perform an operation with a precision defined by the operation standard. Therefore, a machine instruction code is written in such a way as to perform an operation with an operation precision (number of effective digits) of the arithmetic unit, and the precision (number of effective digits) of an instruction code is fixed. As the precision (number of effective digits) cannot be designated in an instruction code itself, the precision should be coped with by a program, thus making program writing complex.